import 'package:flutter/material.dart';
import './index_recommend_data.dart';
import './index_recommend_item_widget.dart';

class IndexRecommend extends StatelessWidget {
  final List<IndexRecommendItem> datalist;

  const IndexRecommend({Key key, this.datalist = indexRecommendData}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.all(8.0),
      decoration: BoxDecoration(
        color: Color(0x08000000)
      ),
      child: Column(
        children: [
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Text('房屋推荐', style: TextStyle(fontWeight: FontWeight.w600),),
              Text('更多', style: TextStyle(fontWeight: FontWeight.w300),)
            ],
          ),
          SizedBox(height: 8.0,),
          Wrap(
            spacing: 10.0,
            runSpacing: 10.0,
            children: indexRecommendData.map((item) => IndexRecommendItemWidget(item)).toList(),
          )
        ],
      ),
    );
  }
}